package com.example.smartcitydemo.ui.job.fragment

import android.os.Bundle
import androidx.fragment.app.activityViewModels
import com.example.smartcitydemo.R
import com.example.smartcitydemo.base.BaseFragment
import com.example.smartcitydemo.databinding.FragmentJobThirdBinding
import com.example.smartcitydemo.ext.init
import com.example.smartcitydemo.ui.job.WorkPersonInfoViewPager2Adapter
import com.example.smartcitydemo.viewModel.person.PersonViewModel

/**
 * @PACKAGE_NAME: com.example.smartcitydemo.ui.job.fragment
 * @NAME: Caleb.F
 * @DATE: 2021/11/18 9:38
 * @Email: 1919796283@qq.com
 */
class JobThirdFragment : BaseFragment<FragmentJobThirdBinding>(R.layout.fragment_job_third) {
    val personViewModel: PersonViewModel by activityViewModels()
    private val workPersonInfoViewPager2Adapter: WorkPersonInfoViewPager2Adapter by lazy {
        WorkPersonInfoViewPager2Adapter(this)
    }


    override fun initData() {
        personViewModel.getPersonInfo()
    }

    override fun initView(bindView: FragmentJobThirdBinding, savedInstanceState: Bundle?) {
        bindView.apply {
            val tabArray = arrayOf("简历", "个人信息")
            workThirdToolbarLayout.tvContent.text = "个人简历"
            myWorkPager2.init(
                workPersonInfoViewPager2Adapter, myWorkTab
            ) { tab, pos ->
                tab.text = tabArray[pos]
            }
        }
    }

    override fun addObservers(bindView: FragmentJobThirdBinding) {

    }
}